package com.hrbxlh.dao;

import java.util.List;
import java.util.Map;

import com.hrbxlh.pojo.Chapter;
import com.hrbxlh.pojo.TaskLibrary;
import com.hrbxlh.vo.ExpreLibraryVO;
import com.hrbxlh.vo.TaskLibraryVO;
import org.springframework.stereotype.Repository;

/**
 * -------------------------------------------------------
 * Copyright (c) 2017, 鑫联华信息科技股份有限公司
 * All rights reserved.
 * FileName：ChapterDao.java
 * Description：ChapterDao类,负责操作章节数据数据。
 * History：
 * Date           Author               Desc
 * 2017.3.27		  xzx                 建立
 * -------------------------------------------------------
 */

@Repository
public interface ChapterDao {

	/**
	 * @description 添加章节
	 * @param Map<String,Object> paramMap
	 * @return boolean (true 成功 ,false失败)
	 * @throws Exception
	 */
	int addChapter(Chapter chapter) throws Exception;

	/**
	 * @description  添加章节上半部分
	 * @param chapterName addTestMark
	 * @param response
	 * @return
	 */
	int addChapterTopOne(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description  添加章节下半部分之章节
	 * @param chapterName addTestMark
	 * @param response
	 * @return
	 */
	Boolean addChapterCourseWare(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description  添加章节之---备课材料or实验手册
	 * @param chapterName addTestMark
	 * @param response
	 * @return
	 */
	Boolean addChapterMaterialOrTest(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description  添加章节下半部分之课程材料
	 * @param chapterName addTestMark
	 * @param response
	 * @return
	 */
	Boolean addChapterPackageFile(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description  添加章节下半部分之视频
	 * @param chapterName addTestMark
	 * @param response
	 * @return
	 */
	Boolean addChapterVideo(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description  添加章节之作业or实验报告
	 * @param chapterName addTestMark
	 * @param response
	 * @return
	 */
	Boolean addChapterHomeworkOrExprement(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 获取某课程的章节信息
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getCourseChapter(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 获取某课程的章节信息(不包括各种文件信息)
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getCourseChapterNotFileInfo(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 获取某课程的某个章节信息(不包括各种文件信息)
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	Map<String, Object> getTeatherCourseChapterNotFileInfoByCourseIdAndChpIterd(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 修改章节
	 * @param Map<String,Object> paramMap
	 * @return boolean (true 成功 ,false失败)
	 * @throws Exception
	 */
	void saveChapter(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 修改章节--清空章节的下半部分
	 * @param Map<String,Object> paramMap
	 * @return boolean (true 成功 ,false失败)
	 * @throws Exception
	 */
	void clearChapterDown(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 查询某课程有没有这个章节
	 * @param courseId,chapterNum
	 * @return
	 * @throws Exception
	 */
	Map<String, Object> getChapterByClassNum(Map<String, Object> paramMap) throws Exception;


	/**商莹
	 * @description 删除章节中的课件、作业、视频
	 * @param courseId,chapterNum,type
	 * @return true成功false失败
	 * @throws Exception
	 */
	boolean delChapterCoHoVo(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 删除本章节作业信息
	 * @param courseId,chapterNum
	 * @return true成功false失败
	 * @throws Exception
	 */
	void delChapterTask(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 删除本章节学生学习信息
	 * @param courseId,chapterNum
	 * @return true成功false失败
	 * @throws Exception
	 */
	void delChapterStudy(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 查询某课程某章节的信息
	 * @param courseId,chapterId
	 * @return Map
	 * @throws Exception
	 */
	Map<String, Object> getCourseOneChapter(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 通过章节名称获取章节信息
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getChapterByName(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 通过章节名称获取章节信息
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getChapterHomeworkList(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 通过课程id获取章节信息并获取该登陆学生的作业提交情况（不包括各种文件信息）
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getChapterHomeworkListNotFileInfo(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 获取某课程的某个章节章节信息
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	Map<String, Object> getStudentCourseChapterNotFileInfoByCourseIdAndChpIterd(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 获取章节列表
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getChapterList(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 查询某个章节的详细信息
	 * @param Map<String,Object> paramMap chapterId
	 * @return Map<String, Object>
	 * @throws Exception
	 */
	Map<String, Object> getOneChapter(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description  批量删除章节信息
	 * @param Map<String,Object> paramMap
	 * @return Map<String, Object>
	 * @throws Exception
	 */
	void delChapters(List<Integer> list) throws Exception;

	/**
	 * @description  批量删除章节与课程的关联信息
	 * @param Map<String,Object> paramMap   章节id list
	 * @return Map<String, Object>
	 * @throws Exception
	 */
	void delChapterReCourse(List<Integer> list) throws Exception;

	/**
	 * @description  查询所有非预置进去的章节信息  按照id排序
	 * @param Map<String,Object>
	 * @return Map<String, Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getAfterSaveChapter(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description  通过chapterId在课程与章节的中间表中进行查询
	 * @param Map<String,Object>
	 * @return Map<String, Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getMsgByCptId(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description  查询id为这些的章节的信息（文件信息）
	 * @param Map<String,Object>
	 * @return Map<String, Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getChapters(List<String> list) throws Exception;

	boolean addTaskLibrary(Map<String,Object> map) throws Exception;

	boolean delTaskLibrary(int chapterId) throws Exception;

	boolean updateHomeworkModelName(Map<String,Object> map) throws Exception;
	/**
	 * 通过课程号和章节号查询是否有数据
	 * @param list
	 * @return
	 * @throws Exception
	 */
	List<TaskLibraryVO> getTaskLibrary(int chapterId) throws Exception;

	boolean addExpreLibrary(Map<String,Object> map) throws Exception;

	boolean delExpreLibrary(int chapterId) throws Exception;

	/**
	 * 通过课程号和章节号查询是否有数据
	 * @param list
	 * @return
	 * @throws Exception
	 */
	List<ExpreLibraryVO> getExpreLibrary(int chapterId) throws Exception;

	/**
	 * 将html代码插入数据库
	 */
	boolean addHtml(Map<String,Object> map) throws Exception;

	/**
	 * 通过chapterId修改备课材料、实验手册、作业、实验报告
	 */
	boolean OnlineEditingChapter(Map<String,Object> map) throws Exception;

	List<Map<String, Object>> getChapterByListId(Map<String,Object> map) throws Exception;

	List<Map<String, Object>> getChapterByNameAndSid(Map<String,Object> map) throws Exception;

	boolean delChapterByChapNameAndSid(Map<String,Object> map) throws Exception;

	/**
	 * 通过学号查询当前学生学习的课程所有的章节数
	 * @param map
	 * @return
	 */
	public List<Map<String, Object>> chapterCountBySid(Map<String,Object> map);

	/**
	 * @description 修改作业or实验报告时先走这个action判断是否有学习记录
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getHistoryStudyByChapIdAndCourseId(Map<String, Object> paramMap) throws Exception;

	/**
	 * @description 通过chapterId查询当前章节是否有学习记录
	 * @param Map<String,Object> paramMap
	 * @return Map<String,Object>
	 * @throws Exception
	 */
	List<Map<String, Object>> getHomeworkListByChapterId(Map<String, Object> paramMap) throws Exception;


}
